<extend name="Base/common2"/>
<block name="body">
<div id="J_main" class="container main">

    <!-- account center start -->
    <section id="J_account" class="clearfix account-center">
        <!-- aside start -->
        <aside class="fl panel aside" style="left: 0px;">
            <a class="active" href="#basic">基本信息</a>
            <a href="#work-setting" class="">工作设置</a>
            <a href="#work-experience" class="">工作经历</a>
            <a href="#edu-experience" class="">教育经历</a>
            <a href="#hobby" class="">兴趣爱好</a>
        </aside>
        <!-- aside end -->
        <!-- content start -->
        <div id="J_content" class="fr form content">
            <!-- basic start -->
            <div id="basic" class="panel">
                <div class="panel-title">
                    <h2>基本信息</h2>
                </div>
                <div class="panel-content">
                    <form id="J_basic" novalidate="novalidate">
                        <fieldset>
                            <label class="form-label" for="name">姓名</label>
                            <input class="form-input" id="name" type="text" value="{$info.name}" maxlength="10" placeholder="请输入姓名">
                        </fieldset>
                        <fieldset>
                            <label class="form-label" for="mobile">联系方式</label>
                            <input class="form-input" id="mobile" type="number" value="{$info.mobile}" maxlength="11" minlength="11"placeholder="请输入联系方式"><!--  disabled="" -->
                        </fieldset>
                        <fieldset>
                            <label class="form-label" for="divide">职称</label>
                            <input class="form-input" id="divide" type="text" value="{$info.divide}" maxlength="10" placeholder="请输入职称">
                        </fieldset>
                        <fieldset>
                            <label class="form-label" for="exprience">工作年限</label>
                            <select class="form-select" id="exprience" name="exprience" readonly="readonly">
                                <option value="0">请选择工作年限</option>
                                <option value="1" <eq name="info.exprience" value="1"> selected </eq> >一年以内</option>
                                <option value="2" <eq name="info.exprience" value="2"> selected </eq> >1-3年</option>
                                <option value="3" <eq name="info.exprience" value="3"> selected </eq> >3-5年</option>
                                <option value="4" <eq name="info.exprience" value="4"> selected </eq> >5-10年</option>
                                <option value="5" <eq name="info.exprience" value="5"> selected </eq> >10年以上</option>
                            </select>
                        </fieldset>
                        <fieldset>
                            <label class="form-label" for="address">当前所在地</label>
                            <input class="form-input" type="text" id="address" name="address" placeholder="XX省XX市XX区" value="{$info.address}">
                        </fieldset>
                        <fieldset>
                            <label class="form-label" for="school">毕业学校</label>
                            <input class="form-input" type="text" id="school" name="address" placeholder="XX学校" value="{$info.school}">
                        </fieldset>
                        <fieldset>
                            <label class="form-label" for="">目前状态</label>
                            <label class="J_radio form-radio <eq name='info.working' value='1'>active</eq>" for="work_status_1"><input id="work_status_1" checked="" type="radio" name="work_status" value="1">接单中(简历显示人才库)</label>
                            <label class="J_radio form-radio <eq name='info.working' value='2'>active</eq>" for="work_status_2"><input id="work_status_2" type="radio" name="work_status" value="2">暂停接单(简历不显示人才库)</label>
                        </fieldset>
                    </form>
                </div>
            </div>
            <!-- work experience start -->
            <div id="work-experience" class="panel">
                <div class="panel-title">
                    <h2>个人简介</h2>
                </div>
                <div class="panel-content">
                    <form class="J_work-form" novalidate="novalidate">
                        <fieldset>
                            <textarea class="form-textarea" id="persondesc" maxlength="140" placeholder="请简单描述下您自己，以便为您找到合适的项目（140字以内）">{$info.persondesc}</textarea>
                        </fieldset>
                    </form>
                </div>
            </div>
            <!-- educational experience start -->
            <div id="account-works" class="panel">
                <div class="panel-title">
                    <h2>作品案例</h2>
                </div>
                <div class="panel-content">
                    <form class="J_edu-form" novalidate="novalidate">
                        <fieldset>
                            <!--<label class="form-label" for="">工作描述</label>-->
                            <textarea class="form-textarea" id="workdesc" maxlength="140" placeholder="请描述下您的相关作品案例历（140字以内）">{$info.workdesc}</textarea>
                        </fieldset>
                    </form>
                </div>
            </div>
            <!-- educational experience end -->

            <a id="J_save" class="btn btn-orange" href="javascript:void(0);">保存</a>
        </div>
        <!-- content end -->
    </section>
    <!-- account center end -->

    <input id="requireModule" type="hidden" data-module="personal-center">

</div>
</block>
<block name="script">
<script type="text/javascript">
    //'index-nav-show'
    (function() {
        var navPanel = $('.nav-panel');
        $('.icon-icon_menu').click(function(){
            navPanel.css('display','block');
        });

        $('.icon-icon_close_m').click(function(){
            navPanel.css('display','none');
        });

        var setHeader = function() {
            var st = $(window).scrollTop();
            if(st > 0) {
                $('.header-pc').removeClass('header-transparent');
            } else {
                $('.header-pc').addClass('header-transparent');
            }
        };
        setHeader();
        $(window).scroll(function() {
            setHeader();
        });

        //简历状态选择
        $('#work_status_1').click(function () {
            $(this).parent().addClass('active');
            $('#work_status_2').parent().removeClass('active');
        });
        $('#work_status_2').click(function () {
            $(this).parent().addClass('active');
            $('#work_status_1').parent().removeClass('active');
        });

        //表单提交
        $('#J_save').click(function () {
            var flag = $('#work_status_1').parent().hasClass('active');

            var pro = {};
            pro.exprience   = $('#exprience').val();
            pro.address     = $('#address').val();
            pro.workdesc    = $('#workdesc').val();
            pro.persondesc  = $('#persondesc').val();
            pro.name        = $('#name').val();
            pro.mobile      = $('#mobile').val();
            pro.divide      = $('#divide').val();
            pro.school      = $('#school').val();
            pro.working     = flag ? 1 : 2;

            $.post("{:U('User/center')}", pro, function (data) {
                if( 1 == data.status ){
                    alert('发布成功');
                    window.location.href = "{:U('User/myworker')}";
                }else {
                    alert('发布失败');
                    return false;
                }
            }, 'json');
        });
    })();
</script>
</block>